package com.yxj.threadcase1;

public class ThreadDemo10 {
    public static void main(String[] args) {
        /*
         * 需求：某电影院正在上映电影票，共100张，有3个窗口售票，请模拟售票过程
         * 利用同步方法完成
         * 技巧：同步代码块*/

        MyRunnable10 mr = new MyRunnable10();

        Thread t1 = new Thread(mr);
        Thread t2 = new Thread(mr);
        Thread t3 = new Thread(mr);

        t1.setName("窗口1");
        t2.setName("窗口2");
        t3.setName("窗口3");

        t1.start();
        t2.start();
        t3.start();
    }
}
